package cn.zyjblogs.netty.inoutbound;


import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;

/**
 * @author zhuyijun
 */
public class MyServerInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ch.pipeline()
                //入栈的handler进行解码
//                .addLast("decoder", new MyByteTOLongDecoder())
                .addLast("decoder", new MyByteTOLongDecoder2())
                //出栈的handler进行编码
                .addLast("encoder",new MyLongTOByteEncoder())
                .addLast(new MyServerHandler());
    }
}
